package thread_pool_executor;

import java.util.concurrent.ThreadPoolExecutor;

/**
 * @author: 史大拿
 * @create: 2022-10-21 09:21
 * TODO
 **/
public class TPEClient1 {
    private static final int COUNT = 100;

    public static void main(String[] args) {

        for (int i = 0; i < COUNT; i++) {
            Thread thread = new Thread(new Runnable() {
                @Override
                public void run() {

                    try {
                        Thread.sleep(2000);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    } finally {
                        System.out.println("线程:" + Thread.currentThread().getName());
                    }
                }
            });

            try {
                thread.start();

                // 线程串形状化
//                thread.join();
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
}
